package com.tao.aszx.manager.controller;


import com.tao.aszx.manager.service.FileUploadService;
import com.tao.aszx.model.vo.common.Result;
import com.tao.aszx.model.vo.common.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin/system")
public class FileUploadController {
    @Autowired
    FileUploadService fileUploadService;


    @PostMapping("/fileUpload")
    public Result<String> fileUpload(@RequestParam MultipartFile file){
        String fileUrl = fileUploadService.fileUpload(file);

        return Result.build(fileUrl , ResultCodeEnum.SUCCESS) ;
    }
}
